package com.dobby.pea.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dobby.pea.entity.tbOrderDetail;
import com.dobby.pea.mapper.OrderDetailMapper;
import com.dobby.pea.service.OrderDetailService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, tbOrderDetail> implements OrderDetailService {

    @Transactional
    public List<tbOrderDetail> OrderDetailById(Long id) {
        LambdaQueryWrapper<tbOrderDetail> queryWrapper= new LambdaQueryWrapper<>();
        queryWrapper.in(tbOrderDetail::getGoodId,id);
        return this.list(queryWrapper);
    }
}